<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml" id="html">
    <head>
        <title></title>
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
        <base href="<?= base_url(1); ?>" />
        <script src="js/time.js?"></script>
        <link type="text/css" href="css/main.css?v=<?= $config['version'] ?>" rel="stylesheet" />
    </head>
    <body>
        <?php include(VIEWPATH . 'common/main_header.php'); ?>
        <form action="" method="POST" id="rowForm">
            <table width="100%" border="0" cellspacing="1" cellpadding="0" class="tablegrid tableedit">
               
                <tr>
                    <td><?= translate('FREEGIFT_KEY_TYPE') ?>:</td>
                    <td><?= $cdkeytype ?></td>
                </tr>
                <tr>
                    <td><?= translate('FREEGIFT_AREAID') ?>:</td>
                    <td>
                    	<select name='row[areaid]' id='areaid'>
                    		<option value='all'> <?= translate('PLASE_SELECT') ?></option>
                    		<?php foreach ($areaid as $key=>$value) {?>
                    			<option value=<?=$key ?>><?=$value ?></option>
                    		<?php }?>
                    	</select>
                    </td>
                </tr>
                <tr>
                    <td><?= translate('STARTDATE') ?>:</td>
                    <td><input type="text" name="row[starttime]" id="starttime" size="25" onclick="SelectDate(this,'yyyy-MM-dd hh:mm:ss',0,10)"/></td>
                </tr>
                <tr>
                    <td><?= translate('ENDDATE') ?>:</td>
                    <td><input type="text" name="row[endtime]" id="endtime" size="25" onclick="SelectDate(this,'yyyy-MM-dd hh:mm:ss',0,10)"/></td>
                </tr>
                <tr>
                    <td><?= translate('FREEGIFT_OBJECTID') ?>:</td>
                    <td><?= $rewardobjectid ?></td>
                </tr>
                <tr>
                    <td><?= translate('FREEGIFT_CDKeyNum') ?>:</td>
                    <td><input type="text" name="row[num]" id="num" size="25" /></td>
                </tr>
				<tr>
					<td><?= translate('FREEGIFT_IS_SAME') ?>:</td>
					<td>
					<input type="radio" name="row[issame]" value="1"  /><?= translate('YES') ?>
					<input type="radio" name="row[issame]" value="0" checked/><?= translate('NO') ?>
					</td>
				</tr>
                <tr>
                    <td></td>
                    <td><input type="submit" value="<?= translate('SHENGCHENG') ?>" id="submit" /> <input type="reset" value="<?= translate('RESET') ?>" id="reset" /></td>
                </tr>
            </table>
        </form>
        <script type="text/javascript">
            SG.init("core.form", function() {
                $.formValidator.initConfig({formid: "#rowForm", submitonce: true});
                $("#num").formValidator({empty: false, onshow: '<?= translate('C_ONLY_NUM') ?>'}).regexValidator({regexp: 'num', datatype: 'enum', onerror: '<?= translate('C_ONLY_NUM') ?>'});
                $("#starttime").formValidator({empty: false, onshow: '<?= translate('C_NOT_EMPTY') ?>'}).regexValidator({regexp: "^((\\d{2}(([02468][048])|([13579][26]))[\\-\\/\\s]?((((0?[13578])|(1[02]))[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])|(3[01])))|(((0?[469])|(11))[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])|(30)))|(0?2[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])))))|(\\d{2}(([02468][1235679])|([13579][01345789]))[\\-\\/\\s]?((((0?[13578])|(1[02]))[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])|(3[01])))|(((0?[469])|(11))[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])|(30)))|(0?2[\\-\\/\\s]?((0?[1-9])|(1[0-9])|(2[0-8]))))))(\\s((([0-1][0-9])|(2?[0-3]))\\:([0-5]?[0-9])((\\s)|(\\:([0-5]?[0-9])))))?$", onerror: '<?= translate('C_INVALID_TIME') ?>'});
                $("#endtime").formValidator({empty: false, onshow: '<?= translate('C_NOT_EMPTY') ?>'}).regexValidator({regexp: "^((\\d{2}(([02468][048])|([13579][26]))[\\-\\/\\s]?((((0?[13578])|(1[02]))[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])|(3[01])))|(((0?[469])|(11))[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])|(30)))|(0?2[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])))))|(\\d{2}(([02468][1235679])|([13579][01345789]))[\\-\\/\\s]?((((0?[13578])|(1[02]))[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])|(3[01])))|(((0?[469])|(11))[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])|(30)))|(0?2[\\-\\/\\s]?((0?[1-9])|(1[0-9])|(2[0-8]))))))(\\s((([0-1][0-9])|(2?[0-3]))\\:([0-5]?[0-9])((\\s)|(\\:([0-5]?[0-9])))))?$", onerror: '<?= translate('C_INVALID_TIME') ?>'});                
            });
        </script>
    </body>
</html>